﻿<%@ Page Title="" Language="C#" MasterPageFile="~/main.Master" AutoEventWireup="true" CodeBehind="cart.aspx.cs" Inherits="comix.cart" ValidateRequest="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
        <script type="text/javascript">
        var carttimeout;

        function showAccount() {
            $('#accountmain').show();
        }

        $(document).ready(function() {

            CreateLargeCartList();

        });

        function CreateLargeCartList() {
            $('#largecarttable').empty();
            var sum = $(".hdsum").val();
        
            var xdat = $(".hdxml").val();

            var xmlDoc = $.parseXML(xdat);
            var counter = 0;
            $(xmlDoc).find('cartItem').each(function() {


            $('#largecarttable').append("<tr><td><img src='http://www.lcomix.com/thumbs/small/" + $(this).attr('id') + ".jpg' width='85' ></img></td><td class='cartitem'>" + $(this).attr('price') + "€</td></tr>");
                counter++;
            })

            if (counter == 0) {
                $('#largecarttable').append("<tr><td class='cartempty'>Το καλάθι σας είναι άδειο</td></tr>")
            }
            else {

                $('#largecarttable').append("<tr><td class='cartitem'>ΣΥΝΟΛΟ:</td><td class='cartitem'>" + sum + "€</td><tr>");
                $('#largecarttable').append("<tr class='cartitem'><td colspan='2' ><a href='cart.aspx'>ΕΠΕΞΕΡΓΑΣΙΑ - ΟΛΟΚΛΗΡΩΣΗ</td></tr>");
            }
        }

   
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<h1>Το καλάθι μου</h1>
       <table width="100%" cellpadding="2" cellspacing="1" id="largecarttable">
   </table>
</asp:Content>
